package com.qfedu.buy.server.dao;

import com.qfedu.buy.server.entity.User;
import org.apache.ibatis.annotations.*;

/**
 * @program: NeighborBuy
 * @description:
 * @author: Feri(邢朋辉)
 * @create: 2021-01-25 15:00
 */
public interface UserDao {
    @Insert("insert into t_user(phone,pass,flag) values(#{phone},#{pass},1)")
    @Options(useGeneratedKeys =true,keyProperty = "id") //获取新增之后的自增主键的值
    int insert(User user);
    @Select("select * from t_user where phone=#{phone}")
    User selectByPhone(String phone);
    @Update("update t_user set pass=#{pass} where id=#{id}")
    int updatePass(@Param("id") int id,@Param("pass") String pass);
}
